module.exports = app => {
    const { STRING, INTEGER, TEXT, DATE, BIGINT, TINYINT, JSON } = app.Sequelize;

    const Post = app.model.define('post', {
        post_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        user_id: { type: BIGINT.UNSIGNED, allowNull: false },
        content: { type: TEXT, allowNull: false },
        images: { type: STRING(255), allowNull: true },
        like_count: { type: INTEGER, allowNull: false, defaultValue: 0 },
        comment_count: { type: INTEGER, allowNull: false, defaultValue: 0 },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 'posts',
        timestamps: false,
    });

    return Post;
};